import request from '@/untils/request';

export const getpuorder = (params) => {
  return request({
    url: `/PuOrder/select`,
    method: 'GET',
    params
  })
}


export const getpuorderbyid = () => {
  return request({
    url: `/PuOrder/getList`,
    method: 'get',
    params:{
      pageNum,
      pageSize
    }
  })
}

export const deletepuorder = (data) => {
  return request({
    url: `PuOrder/delete`,
    method: 'delete',
    data
  })  
}

export  const updatepuorder = (params) => {
  return request({
    url: `PuOrder/updateStatus`,
    method: 'put',
    params
    }) 
}

export const getPuOrderStatus = (params) => {
  return request({
    url: `/PuOrder/selectIs`,
    method: 'get',
    params
  })
}


export  const updateStatus = (puOrder) => {
  return request({
    url: `/PuOrder/updateStatus`,
    method: 'put',
    data:puOrder,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

export const addpuorder = (params) => {
  return request({
    url: `puorder`,
    method: 'post',
    params
  })
}

export const selectAllByReview = () => {
  return request({
    url: `selectAllByReview`,
    method: 'post',
  })
}


export const updatePurchase = (data) => {
  return request({
    url: `updatePurchase`,
    method: 'post',
    data
  })
}
export const selectNumByReview = () => {
  return request({
    url: `selectNumByReview`,
    method: 'post',
  })
}


//查询采购财务审批资格
export const selectPurchase = (PageNum,PageSize) => {
  return request({
    url: 'cgorder/getFinanceList',
    method:'get',
    params:{
      PageNum,
      PageSize
    }
  })
}


//查询采购财务审批资格
export const selectPurchase1 = (PageNum,PageSize) => {
  return request({
    url: 'cgorder/getFinanceList1',
    method:'get',
    params:{
      PageNum,
      PageSize
    }
  })
}


//    采购财务审批

export const updateCg = (id,allocation,renSonb) => {
  console.log(id,allocation,renSonb)
  return request({
    url: 'cgorder/updateFinance',
    method:'put',
    params:{
      id,
      allocation,
      renSonb
    }
  })
}